import Mock from 'mockjs'

const data = Mock.mock({
  'items|30': [{
    id: '@id',
    order: '@id',
    'status|1': ['未完成', '已完成'],
    'statusa|1': ['正常', '空闲', '故障'],
    'statusb|1': ['等待', '正在运行', '已完成', '故障'],
    'statusc|1': ['未领取', '准备中', '已领取'],
    x: '1',
    h: '1',
    num: '5',
    equipmentProcess: 'name',
    starTime: '@datetime',
    endTime: '@datetime',
    userName: '@sentence(10, 20)',
    pageviews: '@integer(300, 5000)'
  }]
})

export default [
  {
    url: '/user/signIn',
    type: 'get',
    response: config => {
      const items = data.items
      return {
        code: 200, success: true, message: '操作成功！',
        data: {
          total: items.length,
          time: '2020-05-20 10:38'
        }
      }
    }
  }, {
    url: '/mobile/getInfo',
    type: 'get',
    response: config => {
      return {
        code: 200, success: true, message: '操作成功！',
        data: {
          post: '四面刨',
          process: '选料',
          responsible: '张三',
          workingHours: 16,
          isSignIn: false
        }
      }
    }
  }, {
    url: '/mobile/getLoadData',
    type: 'get',
    response: config => {
      return {
        code: 200, success: true, message: '操作成功！',
        data: {
          postLoad: 80,
          equipmentLoad: 60
        }
      }
    }
  }
]
